package com.xizi.lotterySystem.service.enumerate;

import lombok.AllArgsConstructor;
import lombok.Getter;

@AllArgsConstructor
@Getter
public enum ActivityStatusEnum {
    RUNNING(1, "进⾏中"),
    COMPLETED(2, "已完成");

    private final Integer code;

    private final String message;

    public static ActivityStatusEnum fromName(String name) {
        for (ActivityStatusEnum activityStatus : ActivityStatusEnum.values()) {
            if (activityStatus.name().equalsIgnoreCase(name)) {
                return activityStatus;
            }
        }
        throw new IllegalArgumentException("Invalid name: " + name);
    }
}
